package org.dark.fund.web;


import org.dark.fund.api.IRateReturnService;
import org.dark.fund.common.ApiResult;
import org.dark.fund.dao.entity.RateReturn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wanlh
 * @since 2021-04-29
 */
@RestController
@RequestMapping("/fund/rate-return")
public class RateReturnController {

    @Autowired
    private IRateReturnService rateReturnService;

    @GetMapping("/{fundCode}")
    public ApiResult<List<RateReturn>> getFundYearEndUpRate(@PathVariable String fundCode) {
        return ApiResult.ok(rateReturnService.getYearEndUpRate(fundCode));
    }


}
